interface arrItem {
    [props: number]: number | string;
}
//用接口定义数组

interface myItem {
    name: string;
    age: number;
    // grade: number[]
    grade: arrItem;
}
//用接口定义每一条数据

let obj2: myItem[] = [
    { name: "小明", age: 18, grade: [100, 200, "300"] },
    { name: "小li", age: 20, grade: [80, 700, 200] },
    { name: "李白", age: 1300, grade: [9000, 8000, 4000] },
];

// interface myPage {
//     pagenum: number,
//     pagesize?: number,
//     id: number
// }
// let params = {
//     pagenum: 10,
//     pagesize: 5,
//     id: 1006
// }


interface typeItem {
    color: string,
    price: number,
    desc: string[]
}
interface goodItem {
    readonly id: number,
    title: string,
    type: typeItem[]
}


let mygood: goodItem[] = [
    {
        id: 0,
        title: "iphone13",
        type: [
            { color: "red", price: 200, desc: ["颜色亮丽", "还有点贵"] },

        ],
    },
    {
        id: 1,
        title: "口红",
        type: [
            {
                color: "ysl400",
                price: 300,
                desc: ["颜色好看"],
            },
            {
                color: "dior 999",
                price: 300,
                desc: ["大红的颜色"],
            },
            {
                color: "死亡芭比粉",
                price: 200,
                desc: ["社死", "显黑"],
            },
        ],
    },
];


